<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var globalVar = 'xyz';
        (function outerFunc(outerArg) {
            var outerVar = 'a';
            (function innerFunc(innerArg) {
                var innerVar = 'b';
                console.log(
                    "outerArg=" + outerArg + "\n" +
                    "innerArg=" + innerArg + "\n" +
                    "outerVar=" + outerVar + "\n" +
                    "innerVar=" + innerVar + "\n" +
                    "globalVar=" + globalVar
                );
                //outerArg=123
               //innerArg = 456
               //outerVar = a
               //innerVar = b
               //globalVar = xyz
            })(456)
        })(123)
    </script>
</body>

</html>